-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat(mobile): add extended wd commands for appium #3326
Conversation
Had to add a lot of types to promises to get everything to compile |
Can we split this into two PRs, one to add the promise types and one to actually do the extend webdriver business? |
I believe this is unblocked now, changing labels. |
Yeah, it was broken, not blocked. Should be fixed now. We'll see what travis says in the morning. |
But honestly it's probably gonna need some cleaning regardless |
Just gonna make sure I didn't screw up doc generation and then this PR will be good to go |
@juliemr ready for review |
try { | ||
extendWDInstance = extendWD(webdriverInstance); | ||
} catch (e) { | ||
// Must not have a driver that can be extended (e.g. directly provided) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does 'directly provided' mean here? Can you add to the comment?
I'll take a look at this today... |
*/ | ||
driver: WebDriver; | ||
driver: ExtendedWebDriver; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is taken care of. This does not appear to have typing implications.
da69654
to
09c3ddc
Compare
@cnishina can I get a re-review? |
@@ -61,6 +62,11 @@ export class Webdriver { | |||
opt_message?: string) => wdpromise.Promise<any>; | |||
} | |||
|
|||
export class ExtendedWebdriver { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit on naming: We are importing ExtendedWebDriver
interface and also have an ExtendedWebdriver
class? By chance could this class be called something else? I almost thought these were the same thing because they differ by d
vs D
. Maybe WebDriverExtended
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, should this extend Webdriver
above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- For consistency, I'll rename
Webdriver
toAbstractWebDriver
and this toAbstractExtendedWebDriver
- Yes
@@ -114,15 +120,15 @@ function buildElementHelper(browser: ProtractorBrowser): ElementHelper { | |||
/** | |||
* @alias browser | |||
* @constructor | |||
* @extends {webdriver.WebDriver} | |||
* @extends {webdriver_extensions.ExtendedWebDriver} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this extends the class above and not really the webdriver_extensions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order for js doc to work, this is the correct type (see old version pointing to webdriver.WebDriver
not Webdriver
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Alright, that makes sense.
@@ -972,4 +986,7 @@ export class ProtractorBrowser extends Webdriver { | |||
untrackOutstandingTimeouts?: boolean): ProtractorBrowser { | |||
return new ProtractorBrowser(webdriver, baseUrl, rootElement, untrackOutstandingTimeouts); | |||
} | |||
|
|||
// Extended webdriver methods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove this comment since there are no methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replied to comments, will implement in a second
@@ -114,15 +120,15 @@ function buildElementHelper(browser: ProtractorBrowser): ElementHelper { | |||
/** | |||
* @alias browser | |||
* @constructor | |||
* @extends {webdriver.WebDriver} | |||
* @extends {webdriver_extensions.ExtendedWebDriver} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order for js doc to work, this is the correct type (see old version pointing to webdriver.WebDriver
not Webdriver
)
@@ -972,4 +986,7 @@ export class ProtractorBrowser extends Webdriver { | |||
untrackOutstandingTimeouts?: boolean): ProtractorBrowser { | |||
return new ProtractorBrowser(webdriver, baseUrl, rootElement, untrackOutstandingTimeouts); | |||
} | |||
|
|||
// Extended webdriver methods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes :P
@@ -61,6 +62,11 @@ export class Webdriver { | |||
opt_message?: string) => wdpromise.Promise<any>; | |||
} | |||
|
|||
export class ExtendedWebdriver { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- For consistency, I'll rename
Webdriver
toAbstractWebDriver
and this toAbstractExtendedWebDriver
- Yes
Please rebase with changes. |
All comments addressed |
6499713
to
6a1f627
Compare
Had to make some minor changes to the website to handle longer inheritance chains
// have to be removed. | ||
patch( | ||
require('selenium-webdriver/lib/command'), require('selenium-webdriver/executors'), | ||
require('selenium-webdriver/http')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the new types, could we import these with
import * as http from 'selenium-webdriver/http';
import * as executors from 'selenium-webdriver/executors';
?
Closed in favor of #3860 |
No description provided.